home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Misc / Digital_Almanac / Install / Developer / Developer.doc < prev    next >
Encoding:
Text File  |  2000-01-31  |  3.5 KB  |  90 lines

  1. Developer information
  2. ---------------------
  3.  
  4. The following text describes, how to control a telescope with Digital Almanac II.
  5. Telescope control is only enabled, if you are a registered user, i.e you own a keyfile !!
  6.  
  7.  
  8. If you have some experience in programming the Amiga, no matter what language you prefer,
  9. it is very easy to read coordinates from DA.
  10.  
  11. But don't expect too much !
  12. All DA does, is to feed a public messageport with its map's center coordinates !
  13. That's all !!
  14.  
  15. You might ask, why not more ?
  16. The question is easy. That's all you need !
  17. Because of the variety of connecting a telescope control to a computer, you must write your
  18. own program to benefit from this feature.
  19. You either need a driver that sends coordinates to your telescope, or you must write your own
  20. driver depending what communication port you use. Generally this is either serial port or the
  21. parallel port.
  22.  
  23.  
  24.  
  25. What must I do as a programmer ?
  26. --------------------------------
  27.  
  28. * Create the public messageport "DA_Port".
  29.   Check first, that this port doesn't already exist. DA is not able to support more than
  30.   one task with the same name of a public messageport !!
  31.  
  32. * Wait for messages to arrive at this port.
  33.  
  34. * Read the message, handle the coordinates and reply the message.
  35.  
  36. * Wait for next message ....
  37.  
  38.  
  39. The main part for you as a programmer is "to handle the coordinates". This is the point
  40. where you must send the coordinates to your telescope (or do whatever you like to).
  41.  
  42.  
  43.  
  44. What must I do as a user ?
  45. --------------------------
  46.  
  47. First start your control program that is to receive the messages, then start DA.
  48. This order is important as DA checks for an existing port named "DA_Port".
  49. If the port exists, then DA will extend the Telescope window with a new group containing
  50. two switches.
  51.  
  52. The first switch is called "Send coordinates" and acts as a master switch.
  53. Setting this switch causes DA to send its center coordinates to "DA_Port".
  54. You are allowed to quit the receiving program any time you like. DA notices a remove of
  55. "DA_Port" and let you know by a requester. In this case you MUST start DA again, if you like
  56. to send its coordinates again.
  57. If the switch is off, nothing will be sent to the port.
  58.  
  59. Note:
  60. You must run DA in the "Local Sky" mode to receive the correct azimuth and horizon angles.
  61. Running DA in "Planetarium" mode causes wrong coordinates !
  62.  
  63. The second switch, called "Standby", tells DA, how to react, when your receiving program
  64. replies the message.
  65. If "Standby" is enabled, then DA will "Wait" for the reply after having sent the message,
  66. i.e. both tasks run syncronous.
  67. If the switch is off, then "DA" will not wait for the reply, i.e the tasks run asyncronous.
  68.  
  69. Note: In reality you must set the animtion time interval to "Realtime" because you want your
  70. telescope to be moved in real time !!
  71.  
  72.  
  73.  
  74. The "Example" program
  75. ---------------------
  76.  
  77. This is a very simple example. It can be run both from CLI or from Workbench.
  78. As described above, first start the example, then start DA.
  79. * Open the Telescope window and you will see the two switches.
  80. * Turn the master switch on.
  81. * Load e.g. the "SolarEclipse1999" from the project folder.
  82. * Choose the "Standby" switch for syncronous or asyncronous mode.
  83. * Open the "Animation" window and start the animation.
  84. * Switch back to Workbench and you will see the map's center coordinates will be displayed.
  85. * Cancel the example by pressing CTRL-C in the output window any time you like.
  86.  
  87. The source code of the example and the include file is written in C (C++).
  88. But according to its simpleness, the example can be easily converted to any other language.
  89.  
  90.